`timescale 1ns/1ps

module booth_multiplier_tb;

    // 输入信号
    reg  [31:0] mul_src1; // 被乘数
    reg  [31:0] mul_src2;   // 乘数
    wire [31:0] mul_result;      // 乘积

    // 实例化 Booth 乘法器
    booth_multiplier uut (
        .mul_src1(mul_src1),
        .mul_src2(mul_src2),
        .mul_result(mul_result)
    );

    // 测试过程
    initial begin
        #100;
        // 测试用例1：两个正数相乘
        mul_src1 = 32'd5;
        mul_src2 = 32'd3;
        #10; // 等待组合逻辑稳定
        $display("Test Case 1: %d * %d = %d", mul_src1, mul_src2, mul_result);

        // 测试用例2：正数乘以负数
        mul_src1 = 32'd7;
        mul_src2 = 32'shFFFFFFFE; // -2
        #10;
        $display("Test Case 2: %d * %d = %d", mul_src1, mul_src2, mul_result);

        // 测试用例3：负数乘以负数
        mul_src1 = 32'shFFFFFFF6; // -10
        mul_src2 = 32'shFFFFFFF6;   // -10
        #10;
        $display("Test Case 3: %d * %d = %d", mul_src1, mul_src2, mul_result);

        // 结束仿真
        #10;
        $stop;
    end